Open
Conversation
|
…andling Add storybook as devDependency to all workspace packages so pnpm hoists a single copy, fixing duplicate action events caused by two separate module instances each registering their own listener. Sanitize RN synthetic events in action payloads only on the WebSocket channel where async transport causes event pool recycling. Remove the unnecessary patch from the local sync channel. Remove early-return guards from addon panels so hooks are called unconditionally, fixing React rules-of-hooks violations.
- Changed annotations parameter type from any[] to ModuleExports[] in resolveAnnotations and getProjectAnnotations functions. - Introduced a PreviewObject interface and isPreviewObject type guard for better handling of preview objects. - Updated storyEntries type to use Record<string, unknown> instead of any for improved type clarity.
- Updated storyEntries and normalizedStories types to use unknown instead of Record<string, unknown> for improved type flexibility.
- Added '@storybook/react-native-theming' as a dependency for theming capabilities. - Updated ActionLogger to use styled components for count text based on the current theme. - Refactored Inspect component to utilize themed text styles for various data types, enhancing visual consistency and readability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for CSF Next, the new Storybook configuration and story authoring format available experimentally in Storybook 10.
CSF Next replaces the traditional
export default meta/export const Storypattern with adefinePreview()/defineMain()/meta.story()API that provides full type safety, composability, and better IDE support.Core changes
definePreview()support — Re-exportsdefinePreviewfrom@storybook/reactand addsresolveAnnotations()inStart.tsxto unwrap the opaquePreviewobject thatdefinePreview()produces. We extract.input(the user's plain config) rather than using.composed, which includes web-specific core annotations that depend on a browser environment not available on-device.defineMain()support — Adds a typeddefineMain()helper exported from@storybook/react-native/nodefor type-safe main config.StorybookConfigtype refinement — Moved totypes/config.ts, now usesPresettype for addons instead of loose string/object union.any[]withModuleExports[]andunknownthroughoutStart.tsx.Examples and tests
.factories.stories.tsxvariants for all existing example stories demonstrating the factories API.factories.test.tsxportable story tests for factories stories.rnstorybook-nofactories/config directory to test both config styles side-by-sidemetro.config.jsandApp.tsxto support switching between factories and non-factories configsHow the factories API looks
preview.tsx (before):
preview.tsx (after):
Stories (before):
Stories (after):
Test plan
pnpm buildcompletes successfullypnpm testpasses — both factories and non-factories story testsdefinePreview()config is properly unwrapped (parameters, decorators, etc. are applied)defineMain()provides type checking for main config